spin_barrier(&d->domain_lock);
evtchn_destroy(d);
gnttab_release_mappings(d);
+ tmem_destroy(d->tmem);
+ d->tmem = NULL;
/* fallthrough */
case DOMDYING_dying:
rc = domain_relinquish_resources(d);
grant_table_destroy(d);
- if ( d->tmem != NULL )
- tmem_destroy(d->tmem);
-
arch_domain_destroy(d);
rangeset_domain_destroy(d);
{
list_del(&client->client_list);
tmh_client_destroy(client->tmh);
- tmh_set_current_client(NULL);
tmem_free(client,sizeof(client_t),NULL);
}
{
client_t *client = (client_t *)v;
+ if ( client == NULL )
+ return;
+
if ( tmh_lock_all )
spin_lock(&tmem_spinlock);
else
write_lock(&tmem_rwlock);
- if ( client == NULL )
- printk("tmem: can't destroy tmem pools for %s=%d\n",
- cli_id_str,client->cli_id);
- else
- {
- printk("tmem: flushing tmem pools for %s=%d\n",
- cli_id_str,client->cli_id);
- client_flush(client,1);
- }
+ printk("tmem: flushing tmem pools for %s=%d\n",
+ cli_id_str, client->cli_id);
+ client_flush(client, 1);
if ( tmh_lock_all )
spin_unlock(&tmem_spinlock);